const express = require('express')
const router = express.Router()
const { getPropertyList, getPropertyDetail, getHotProperty, getApartmentInfo, getVillaInfo, searchProperty } = require('../../controller/web/propertyController')

// 导入JWT拦截中间件
const checkTokenMiddleware = require('../../middlewares/checkTokenMiddleware')

// 获取全部房源的列表信息
router.get('/property/list', getPropertyList)

// 获取房源详情信息
router.get('/property/detail/:id', checkTokenMiddleware, getPropertyDetail)

// 获取热门房源信息
router.get('/hot', getHotProperty)

// 获取品牌公寓信息
router.get('/apartment', getApartmentInfo)

// 获取精选别墅信息
router.get('/villa', getVillaInfo)

// 搜索房源
router.get('/property/search', checkTokenMiddleware, searchProperty)

module.exports = router